/**
 * Created by fanj on 16-10-14.
 */
$(document).ready(function(){
    swith_background();
    change_sign();
});
function swith_background(){
    var time = "";
    var index = 1;
    $(function () {
        showimg(index);
        $(".imgnum a").hover(function () {
            clearTimeout(time);
            var icon=$(this).text();
            $(".imgnum a").removeClass("onselect").eq(icon-1).addClass("onselect");
            $("#banner_img li").hide().stop(true,true).eq(icon-1).fadeIn("slow");
        }, function () {
            index=$(this).text()> 4 ? 1 :parseInt($(this).text())+1;
            time = setTimeout("showimg(" + index + ")", 3000);
        });
    });

    function showimg(num) {
        index = num;
        $(".imgnum a").removeClass("onselect").eq(index-1).addClass("onselect");
        $("#banner_img li").hide().stop(true,true).eq(index-1).fadeIn("slow");
        index = index + 1 > 5 ? 1 : index + 1;
        time = setTimeout("showimg(" + index + ")", 1000);
    }
}
//function change_sign(){
//    $(".search_nav .btn_xh a,.search_nav .btn_wl a").hover(function(){
//        $(".search_nav .btn_zj a").css( 'background-color',"#857775",'color',"#fff")
//    })
//}